<?php
/* @var $this CmContactController */
/* @var $model CmContact */
/* @var $form CActiveForm */
?>

<div class="info_form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'cm-contact-form',
	'htmlOptions' => array(
		'name' => 'infoform'
	),
	'enableAjaxValidation'=>false,
)); ?>

	<div class="form_header">Information</div>

	<?php // echo $form->errorSummary($model); ?>

	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($model,'first_name'); ?></div>
		<?php echo $form->textField($model,'first_name',array('maxlength'=>100)); ?>
		<?php echo $form->error($model,'first_name'); ?>
	</div>
	
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($model,'last_name'); ?></div>		
		<?php echo $form->textField($model,'last_name',array('maxlength'=>100)); ?>
		<?php echo $form->error($model,'last_name'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->label($model,'email');?></div>
		<?php echo $form->textField($model,'email',array('maxlength'=>100)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>	
	<div class="form_row">
		<div class="label_container">
			<?php echo $form->labelEx($details, 'home_phone'); ?>		
			<?php echo $form->radioButton($details, 'best_phone', array('value' => CmDetails::HOME_PHONE, 'uncheckValue' => null)); ?>
		</div>
		<?php echo $form->textField($details, 'home_phone',array('maxlength'=>50)); ?>
		
		<?php echo $form->error($details, 'home_phone'); ?>
	</div>
	<div class="form_row">
		<div class="label_container">
			<?php echo $form->labelEx($details, 'work_phone'); ?>
			<?php echo $form->radioButton($details, 'best_phone', array('value' => CmDetails::WORK_PHONE, 'uncheckValue' => null)); ?>
		</div>
		<?php echo $form->textField($details, 'work_phone',array('maxlength'=>50)); ?>
		
		<?php echo $form->error($details, 'work_phone'); ?>
	</div>
	<div class="form_row">
		<div class="label_container">
			<?php echo $form->labelEx($details, 'cell_phone'); ?>
			<?php echo $form->radioButton($details, 'best_phone', array('value' => CmDetails::CELL_PHONE, 'uncheckValue' => null)); ?>
		</div>
		<?php echo $form->textField($details, 'cell_phone',array('maxlength'=>50)); ?>
		
		<?php echo $form->error($details, 'cell_phone'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'address_1'); ?></div>
		<?php echo $form->textField($details, 'address_1',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'address_1'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'address_2'); ?></div>
		<?php echo $form->textField($details, 'address_2',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'address_2'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'city'); ?></div>
		<?php echo $form->textField($details, 'city',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'city'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'state'); ?></div>
		<?php echo $form->textField($details, 'state',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'state'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'zip'); ?></div>
		<?php echo $form->textField($details, 'zip',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'zip'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'country'); ?></div>
		<?php echo $form->textField($details, 'country',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'country'); ?>
	</div>
	<div class="form_row">
		<div class="label_container"><?php echo $form->labelEx($details, 'birthday'); ?></div>
		<div class="birthday_input">
			<select name="CmDetails[birth_day]">
				<?php
					$day = $details->getBirthDay();
					$month = $details->getBirthMonth();
					$year = $details->getBirthYear();
					for ($i = 1; $i <= 31; $i++) :
				?>
				<option <?php if($i === $day){echo 'selected';}?> value="<?php echo $i ?>"><?php echo $i ?></option>
				<?php
					endfor;
				?>
			</select>
			<select name="CmDetails[birth_month]">
				<?php
					for ($i = 1; $i <= 12; $i++) :
				?>
				<option <?php if($i === $month){echo 'selected';}?> value="<?php echo $i ?>"><?php echo $i ?></option>
				<?php
					endfor;
				?>
			</select>
			<select name="CmDetails[birth_year]">
				<?php
					for ($i = 1980; $i < 2005; $i++) :
				?>
				<option <?php if($i === $year){echo 'selected';}?> value="<?php echo $i ?>"><?php echo $i ?></option>
				<?php
					endfor;
				?>
			</select>
		</div>
		
		<?php // echo $form->textField($details, 'birthday',array('maxlength'=>50)); ?>
		<?php echo $form->error($details, 'birthday'); ?>
	</div>

<!--	<div class="row buttons">
		<?php // echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>-->
<div class="clear"></div>
	<div class="submit_container">
		<div class="menu_button">
			<span class="login_button"><a href="#" onclick="document.infoform.submit(); return false;">Done</a></span>
		</div>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->